package Parkour;

import javax.imageio.ImageIO;
import java.awt.*;
import java.io.File;
import java.util.Random;

public class Barrs_4 {
    private Image image;
    private  Image images[];
    public static final int WIDTH = 150;
    public static final int HEIGHT = 350;
    private int x,y;

    public Barrs_4(){
        Random random = new Random();
        images = new Image[4];
        try {
            images[0] =ImageIO.read(new File("images/parkour/11.png"));
            images[1] =ImageIO.read(new File("images/parkour/12.png"));
            images[2] =ImageIO.read(new File("images/parkour/13.png"));
            images[3] =ImageIO.read(new File("images/parkour/14.png"));
        }catch (Exception e){

        }
        image = images[random.nextInt(4)];
        x= GameFrame.WIDTH+1500;
        y=0;
    }
    public void step(){
        x-=20;
    }
    public void paintBarrs(Graphics g){
        g.drawImage(image, x, y, WIDTH, HEIGHT, null);
    }
    public boolean outofBounds(){
        return this.x<=-WIDTH;
    }
    public Image getImage() {
        return image;
    }
    public void setImage(Image image) {
        this.image = image;
    }
    public Image[] getImages() {
        return images;
    }
    public void setImages(Image[] images) {
        this.images = images;
    }
    public int getX() {
        return x;
    }
    public void setX(int x) {
        this.x = x;
    }
    public int getY() {
        return y;
    }
    public void setY(int y) {
        this.y = y;
    }
    public static int getWidth() {
        return WIDTH;
    }
    public static int getHeight() {
        return HEIGHT;
    }

}